﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace SoundServant.Controls
{
    /// <summary>
    /// Interaction logic for CDControl.xaml
    /// </summary>
    public partial class CDQueueControl : UserControl
    {
        CD cd;
        Burner max;
        private delegate void VoidInvokeHandler();

        public CDQueueControl(CD _cd, Burner _max)
        {
            InitializeComponent();
            cd = _cd;
            max = _max;
            Draw();
        }


        private void Draw()
        {
            DateAbbrvLabel.Content = cd.Disc.Recording.Date.ToString("ddd dd MMM yy");
            TypeLabel.Content = SS.AbbrMeetingType(cd.Disc.Recording.Type);

            SummaryTextBlock.Text = cd.Disc.Summary;
            ForWhoLabel.Content = "CD For: " + cd.ForWho;
            QueueNumLabel.Content = cd.Num;
        }

        private void UserControl_MouseDown(object sender, MouseButtonEventArgs e)
        {
            if (SSMessageBox.Show("Remove CD from Queue?", "Are you sure you want to remove this CD from the queue?", SSMessageBoxType.YesNo) == SSMessageBoxResult.Yes)
            {
                max.CancelCD(cd);
            }
        }


    }
}
